<?php

/**
 * Character form base class.
 *
 * @method Character getObject() Returns the current form's model object
 *
 * @package    rpgcom
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseCharacterForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'idCharacter'  => new sfWidgetFormInputHidden(),
      'idUser'       => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => false)),
      'idChronicle'  => new sfWidgetFormPropelChoice(array('model' => 'Chronicle', 'add_empty' => true)),
      'idStatus'     => new sfWidgetFormPropelChoice(array('model' => 'Status', 'add_empty' => false)),
      'name'         => new sfWidgetFormInputText(),
      'concept'      => new sfWidgetFormInputText(),
      'idVirtue'     => new sfWidgetFormPropelChoice(array('model' => 'Virtue', 'add_empty' => true)),
      'idVice'       => new sfWidgetFormPropelChoice(array('model' => 'Vice', 'add_empty' => true)),
      'faction'      => new sfWidgetFormInputText(),
      'groupName'    => new sfWidgetFormInputText(),
      'age'          => new sfWidgetFormInputText(),
      'idBloodline'  => new sfWidgetFormPropelChoice(array('model' => 'Bloodline', 'add_empty' => true)),
      'idClan'       => new sfWidgetFormPropelChoice(array('model' => 'Clan', 'add_empty' => true)),
      'idCovenant'   => new sfWidgetFormPropelChoice(array('model' => 'Covenant', 'add_empty' => true)),
      'idAuspice'    => new sfWidgetFormPropelChoice(array('model' => 'Auspice', 'add_empty' => true)),
      'idTribe'      => new sfWidgetFormInputText(),
      'idLodge'      => new sfWidgetFormInputText(),
      'idAdvantages' => new sfWidgetFormPropelChoice(array('model' => 'Advantages', 'add_empty' => true)),
      'xpTotal'      => new sfWidgetFormInputText(),
      'xpActual'     => new sfWidgetFormInputText(),
      'dtIni'        => new sfWidgetFormDate(),
      'dtEnd'        => new sfWidgetFormDate(),
    ));

    $this->setValidators(array(
      'idCharacter'  => new sfValidatorPropelChoice(array('model' => 'Character', 'column' => 'idCharacter', 'required' => false)),
      'idUser'       => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'idUser')),
      'idChronicle'  => new sfValidatorPropelChoice(array('model' => 'Chronicle', 'column' => 'idChronicle', 'required' => false)),
      'idStatus'     => new sfValidatorPropelChoice(array('model' => 'Status', 'column' => 'idStatus')),
      'name'         => new sfValidatorString(array('max_length' => 255)),
      'concept'      => new sfValidatorString(array('max_length' => 255)),
      'idVirtue'     => new sfValidatorPropelChoice(array('model' => 'Virtue', 'column' => 'idVirtue', 'required' => false)),
      'idVice'       => new sfValidatorPropelChoice(array('model' => 'Vice', 'column' => 'idVice', 'required' => false)),
      'faction'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'groupName'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'age'          => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'idBloodline'  => new sfValidatorPropelChoice(array('model' => 'Bloodline', 'column' => 'idBloodline', 'required' => false)),
      'idClan'       => new sfValidatorPropelChoice(array('model' => 'Clan', 'column' => 'idClan', 'required' => false)),
      'idCovenant'   => new sfValidatorPropelChoice(array('model' => 'Covenant', 'column' => 'idCovenant', 'required' => false)),
      'idAuspice'    => new sfValidatorPropelChoice(array('model' => 'Auspice', 'column' => 'idAuspice', 'required' => false)),
      'idTribe'      => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'idLodge'      => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'idAdvantages' => new sfValidatorPropelChoice(array('model' => 'Advantages', 'column' => 'idAdvantages', 'required' => false)),
      'xpTotal'      => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'xpActual'     => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'dtIni'        => new sfValidatorDate(),
      'dtEnd'        => new sfValidatorDate(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('character[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Character';
  }


}
